<template>
  <view>
    <!-- 头部导航栏 -->
    <view class="main_box">
      <view class="top-navigate" style="padding: 53px 10px 20px 10px;color: white;">
        <view class="content cuIcon-back text-xl" @click="goBack">
        </view>
        <view class="text-xl top-navigate-title">收入查询</view>
      </view>
      <view class="num">
        <view class="title">
          配送费收入（元）
        </view>
        <view class="all">
          {{runnerInfo.money}}
        </view>
      </view>
    </view>

    <!-- 列表 -->
    <view v-for="(item,index) in finishedOrder" :key="index">
      <view class="list_box" @click="navTo(item)">
        <view class="left">
          <view class="">
            {{item.orderInfo.type+'订单派送-'+item.userInfo.userName}}
          </view>
          <view class="time">
            {{item.finishedTime}}
          </view>
        </view>
        <view class="">
          +{{item.orderInfo.price}}
        </view>
      </view>
    </view>


  </view>
</template>

<script>
  import amap from '@/helper/amap-wx.130.js'
  import {
    mapState,
    mapMutations,
    mapActions
  } from 'vuex'
  import getCurrentDateTime from '../../utils/currentTime.js'
  const db = uniCloud.database();
  export default {
    data() {
      return {
        finishedOrder: [],
      }
    },
    onLoad(options) {
      this.getRunnerInfo(this.runnerInfo._id);
      this.finishedOrder = this.orderList.filter((item) => item.finished);
    },
    methods: {
      ...mapActions('m_runner', ['getRunnerInfo', 'getAllOrderList']),
      goBack() {
        uni.navigateBack(-1)
        // uni.redirectTo({
        //   url: '/subpkg-runner/runner-rush-order/runner-rush-order'
        // });
      },
      navTo(item) {
        uni.navigateTo({
          url: '/subpkg-runner/runner-order-detail/runner-order-detail?order=' + JSON.stringify(item)
        })
      },
    },
    computed: {
      ...mapState('m_runner', ['runnerInfo', 'orderList']),
      //地图高度属性
      heightCom() {
        let systemInfo = uni.getSystemInfoSync();
        return `${systemInfo.windowHeight-97}px`;
      },
    },
    watch: {

    },
  }
</script>

<style lang="scss">
  page {
    background-color: #ecfdfa;
  }

  .main_box {
    height: 200px;
    width: 100%;
    background-color: #2aba66;
    color: white;

    .top-navigate {
      z-index: !important;
      position: relative;
      display: flex;
      justify-content: left;
      align-items: center;
      font-weight: bold;

      .top-navigate-title {
        margin: 0 auto;

      }
    }

    .num {
      margin: 0 16px;
      width: calc(100% - 32px);
      color: white;
    }

    .all {
      margin-top: 20px;
      font-size: 36px;
      font-weight: 700;
    }
  }

  .list_box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
    padding: 16px;
    background-color: white;
    border-bottom: 1px solid grey;

    .left {
      font-size: 12px;
      display: flex;
      flex-direction: column;
      gap: 5px;

      .time {
        color: #949494;
      }
    }
  }
</style>